package com.atguigu.gulimall.product.feign.fallback;

import com.atguigu.common.utils.R;
import com.atguigu.common.exception.BizCodeEnume;
import com.atguigu.gulimall.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: wei-xhh
 * @create: 2020-08-03
 */
//远程调用失败后的熔断
@Component
@Slf4j
public class SeckillFeignServiceFallBack implements SeckillFeignService {
    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.info("熔断方法调用...getSkuSeckillInfo");
        return R.error(BizCodeEnume.TO_MANY_REQUEST.getCode(),BizCodeEnume.TO_MANY_REQUEST.getErrorMessage());
    }
}
